package swd.basic.conf_prg_button;

import com.pub.database.*;
import java.util.*;
import javax.servlet.http.*;

public class View {
    public View() {
        setMultiLang();
        setDBProperties();
    }

    private HttpServletRequest request = null;
    private HttpServletResponse response = null;
    public void setResponse(HttpServletResponse response) {
        this.response = response;
    }

    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }

    public HttpServletResponse getResponse() {
        return response;
    }

    public HttpServletRequest getRequest() {
        return request;
    }

    private String gstrOnloadScript;
    public String getOnloadScript() {
        return this.gstrOnloadScript;
    }

    public void setOnloadScript(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrOnloadScript = pstrParameter;
    }

    private String gstrPrgAction;
    public String getPrgAction() {
        return this.gstrPrgAction;
    }

    public void setPrgAction(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgAction = pstrParameter;
    }

    private String gstrPrgStatus;
    public String getPrgStatus() {
        return this.gstrPrgStatus;
    }

    private String gstrDBAlias;
    public String getDBAlias() {
        return this.gstrDBAlias;
    }

    public void setDBAlias(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrDBAlias = pstrParameter;
    }

    private boolean gblnDBDebug;
    public boolean getDBDebug() {
        return this.gblnDBDebug;
    }

    public void setDBDebug(boolean pblnParameter) {
        this.gblnDBDebug = pblnParameter;
    }

    private String gstrSourceCharset;
    public String getSourceCharset() {
        return this.gstrSourceCharset;
    }

    public void setSourceCharset(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrSourceCharset = pstrParameter;
    }

    private String gstrTargetCharset;
    public String getTargetCharset() {
        return this.gstrTargetCharset;
    }

    private String gstrPrgTitle;
    public String getPrgTitle() {
        return this.gstrPrgTitle;
    }

    public void setPrgTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgTitle = pstrParameter;
    }

    public void setTargetCharset(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrTargetCharset = pstrParameter;
    }

    private String gstrBtnQueryTitle;
    public String getBtnQueryTitle() {
        return this.gstrBtnQueryTitle;
    }

    public void setBtnQueryTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnQueryTitle = pstrParameter;
    }

    private String gstrBtnDraftTitle;
    public String getBtnDraftTitle() {
        return this.gstrBtnDraftTitle;
    }

    public void setBtnDraftTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnDraftTitle = pstrParameter;
    }
    private String data_kind = null;

    private String btnCreateBtnTitle=null;

    private DataView dataView = null;
    private DataViewForm dataViewForm = null;
    private String changeRowNum = null;
    private String dataview_row_status[] = null;
    private String dataViewHtml = null;
    private String dataViewAppendRowScript=null;

    private String prg_no=null;
    private String prg_no_title=null;
    private String special_name_e[] =null;

    private void setMultiLang() {
        ResourceBundle rbdTitleResource = ResourceBundle.getBundle(
                "swd\\basic\\conf_prg_button\\Multi-lang", Locale.getDefault());

        try {
            setPrgTitle(rbdTitleResource.getString("prgTitle"));
            setBtnQueryTitle(rbdTitleResource.getString("BtnQueryTitle"));
            setBtnCreateBtnTitle(rbdTitleResource.getString("BtnCreateBtnTitle"));
            setPrg_no_title(rbdTitleResource.getString("prg_no_title"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void setDBProperties() {
        ResourceBundle rbdTitleResource = ResourceBundle.getBundle("WEB_Config",
                Locale.getDefault());

        try {
            setDBAlias(rbdTitleResource.getString("DB_ALIAS"));
            setDBDebug(Boolean.valueOf(rbdTitleResource.getString("DEBUG")).
                       booleanValue());
            setSourceCharset(rbdTitleResource.getString("SOURCE_CHARSET"));
            setTargetCharset(rbdTitleResource.getString("TARGET_CHARSET"));
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            rbdTitleResource = null;
        }
    }

    public String getMessage(String pstrKey) {
        return ResourceBundle.getBundle(
                "swd\\basic\\conf_prg_button\\Multi-lang", Locale.getDefault()).
                getString(pstrKey);
    }

    public void setDataViewHtml(String dataViewHtml) {
        this.dataViewHtml = dataViewHtml;
    }


    public void setDataViewForm(DataViewForm dataViewForm) {
        this.dataViewForm = dataViewForm;
    }

    public void setDataView(DataView dataView) {
        this.dataView = dataView;
    }

    public void setData_kind(String data_kind) {
        this.data_kind = data_kind;
    }

    public void setDataview_row_status(String[] dataview_row_status) {
        this.dataview_row_status = dataview_row_status;
    }

    public void setChangeRowNum(String changeRowNum) {
        this.changeRowNum = changeRowNum;
    }

    public void setPrg_no_title(String prg_no_title) {
        this.prg_no_title = prg_no_title;
    }

    public void setPrg_no(String prg_no) {
        this.prg_no = prg_no;
    }

    public void setSpecial_name_e(String[] special_name_e) {
        this.special_name_e = special_name_e;
    }

    public void setBtnCreateBtnTitle(String btnCreateBtnTitle) {
        this.btnCreateBtnTitle = btnCreateBtnTitle;
    }

    public void setDataViewAppendRowScript(String dataViewAppendRowScript) {
        this.dataViewAppendRowScript = dataViewAppendRowScript;
    }

    public String getDataViewHtml() {
        return dataViewHtml;
    }

    public DataViewForm getDataViewForm() {
        return dataViewForm;
    }

    public DataView getDataView() {
        return dataView;
    }

    public String getData_kind() {
        return data_kind;
    }

    public String[] getDataview_row_status() {
        return dataview_row_status;
    }

    public String getChangeRowNum() {
        return changeRowNum;
    }

    public String getPrg_no_title() {
        return prg_no_title;
    }

    public String getPrg_no() {
        return prg_no;
    }

    public String[] getSpecial_name_e() {
        return special_name_e;
    }

    public String getBtnCreateBtnTitle() {
        return btnCreateBtnTitle;
    }

    public String getDataViewAppendRowScript() {
        return dataViewAppendRowScript;
    }


}
